<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!--首页css-->

    <link rel="stylesheet" href="../../static/css/login.css" />
    <title>创建套账</title>
</head>
<body>
<div class="logo" onclick="toHome()"></div>
<span class="text" onclick="toHome()">慧上云</span>

<div style="position: absolute;z-index: 103;right:15px;top:30px;width:150px;height:45px;line-height: 45px;text-align: center;cursor: pointer">
    <a href="login.html"><div class="btn" style="width: 150px;background: rgba(72, 180, 209,0.4);">登录</div></a>
</div>

<div style="position: absolute;z-index: 100;width:100%;height:100%;background-image: url('../../static/images/loginbg.jpg');background-size: 100%;"></div>
<div id="regmodel" style="position: absolute;z-index: 101;width:100%;height:100%;background: #007ACA;filter:alpha(Opacity=40);-moz-opacity:0.4;opacity: 0.4;"></div>
<div id="regmodel_txt" style="position: absolute;z-index: 111;width:100%;height:100px;top:200px;text-align: center;display: none;font-size: 28px;">创建中，请稍后</div>
<div style="position: absolute;z-index: 102;width:100%;height:100%;background: none;margin:0 auto;">
    <form method="post" action="/crm/platform/create" target="regFrame" id="regForm">
        <input type="hidden" name="randomId" value="" id="randomId"/>
        <div class="login" style="margin-top: 100px;">
            <div class="line" style="font-size: 26px;color:#fff;font-weight: 700;">
                公司名称
            </div>
            <div class="line" style="">
                <input class="input" name="companyName" id="companyName" type="text" placeholder="公司名称" autocomplete="off"/>
            </div>
            <div class="line" style="font-size: 26px;color:#fff;font-weight: 700;">
                所属行业
            </div>
            <div class="line" style="">
                <table class="reg-table">
                    <tr>
                        <td><input class="ck" value="1" name="industryType" type="radio" id="hy1"/><label for="hy1">通用行业</label></td>
                        <td><input class="ck" value="2" name="industryType" type="radio" id="hy2"/><label for="hy2">电子通讯</label></td>
                        <td><input class="ck" value="3" name="industryType" type="radio" id="hy3"/><label for="hy3">服装鞋帽</label></td>
                        <td><input class="ck" value="4" name="industryType" type="radio" id="hy4"/><label for="hy4">食品药物</label></td>
                    </tr>
                    <tr>
                        <td><input class="ck" value="5" name="industryType" type="radio" id="hy5"/><label for="hy5">3C数码</label></td>
                        <td><input class="ck" value="6" name="industryType" type="radio" id="hy6"/><label for="hy6">母婴玩具</label></td>
                        <td><input class="ck" value="7" name="industryType" type="radio" id="hy7"/><label for="hy7">美容美发</label></td>
                        <td><input class="ck" value="8" name="industryType" type="radio" id="hy8"/><label for="hy8">珠宝首饰</label></td>
                    </tr>
                    <tr>
                        <td><input class="ck" value="9" name="industryType" type="radio" id="hy9"/><label for="hy9">医疗器械</label></td>
                        <td><input class="ck" value="10" name="industryType" type="radio" id="hy10"/><label for="hy10">汽修汽配</label></td>
                        <td><input class="ck" value="11" name="industryType" type="radio" id="hy11"/><label for="hy11">装修家居</label></td>
                        <td><input class="ck" value="12" name="industryType" type="radio" id="hy12"/><label for="hy12">五金建材</label></td>
                    </tr>
                </table>

            </div>
            <div class="line" style="">
                <div class="btn" id="reg" onclick="create()">创建套账</div>
            </div>
        </div>
    </form>
</div>

<iframe width="0" height="0" name="regFrame" id="regFrame"></iframe>

<script type="text/javascript">
    function create() {

        var randomIdStr = location.href.substr(location.href.indexOf('?')+1).split('=');
        if( randomIdStr[0] == 'randomId' ){
            document.getElementById('randomId').value = randomIdStr[1];
        }
        var companyName = document.getElementById('companyName').value;
        if( companyName == null || companyName.length==0 ){
            alert('请填写公司名称');
            return;
        }

        var radios = document.getElementsByName("industryType");
        var value = 0;
        for(var i=0;i<radios.length;i++){
            if(radios[i].checked == true){
                value = radios[i].value;
                break;
            }
        }

        if( value == 0 ){
            alert('请选择所属行业');
            return;
        }


        document.getElementById('regForm').submit();
        document.getElementById('regmodel').style.background = 'gray';
        document.getElementById('regmodel').style.opacity = '0.8';
        document.getElementById('regmodel').style['z-index'] = 110;
        document.getElementById('regmodel_txt').style.display = 'block';
    }

    function created(resp) {
        if( resp.result == 0 ){
            top.location.href = "/html/index/login.html";
        }
    }

    function toHome() {
        top.location.href = "../../portal/portal.html";
    }
</script>
</body>
</html>

